﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace RFW.Silverlight.Weather
{
	public partial class Thermometer : UserControl
	{
		public Thermometer()
		{
			InitializeComponent();
		}

		private void CanvasMinMax_SizeChanged(object sender, SizeChangedEventArgs e)
		{
			double height = e.NewSize.Height - 22;

			pbMax.Points = new PointCollection() { new Point(2, height), new Point(12, height - 6), new Point(12, height + 6), new Point(2, height) };
			pbMin.Points = new PointCollection() { new Point(2, height), new Point(12, height - 6), new Point(12, height + 6), new Point(2, height) };
			pbValue.Points = new PointCollection() { new Point(2, height), new Point(12, height - 6), new Point(12, height + 6), new Point(2, height) };
		}

		private void CanvasProgressBar_SizeChanged(object sender, SizeChangedEventArgs e)
		{
			double height = e.NewSize.Height;

			pbData.Width = height;
			pbRotation.CenterX = height / 2.0;
			pbRotation.CenterY = height / 2.0;
		}
	}
}
